<?php
/**
 * Header code file for the customer's Account page
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 4824 2006-10-23 21:01:28Z drbyte $
 */
function get_nickname_from_id($id)
{
    $sql = "SELECT customers_nickname FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $id . "'";
    global $db;
    $result = $db->Execute($sql);
    return isset($result->fields) ? strtolower($result->fields['customers_nickname']) : null;
}

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));


$nick = get_nickname_from_id($_SESSION['customer_id']);
if($nick!=null){
    header("Location: index.php?main_page=account");
}
?>